#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int n;
  cin>>n;
  double t=0,t1=0,t2=0;
  double x,y,m;
  for(int i=0;i<n;i++)
  {
    cin>>x>>y>>m;
    t1+=hypot(x,y)/25;
    t2+=m*1.5;
  }
  t=t1+t2;
  cout<<(int)ceil(t);
}